package es.iespuertodelacruz.dai.buscaminas.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

import es.iespuertodelacruz.dai.buscaminas.modelo.Tablero;

public class JMenuItemListener implements ActionListener {

	public static final int CMD_TABLERO101020 = 10001;
	public static final int CMD_TABLERO202050 = 10002;
	public static final int CMD_TABLERO252575 = 10003;
	
	
	@Override
	public void actionPerformed(ActionEvent e) {

		JMenuItem mnt = (JMenuItem)e.getSource();
		int acmd = Integer.parseInt(mnt.getActionCommand());
			
		switch (acmd) {
		
		case CMD_TABLERO101020:
			Tablero.getInstance().setup(10, 10, 20);
			break;
			
		case CMD_TABLERO202050:
			Tablero.getInstance().setup(20, 20, 50);
			break;
						
		case CMD_TABLERO252575:
			Tablero.getInstance().setup(25, 25, 75);
			break;
						
		}

	}

}
